<?
require_once('common.php');
require_once('../bin/db.php');

$table=$_POST['table'];
$url=$_POST['url'];
$db= new MySQL_Class();
$db->Create();
	
while (list ($key, $val) = each ($_POST['pub'])) {
		if (!is_numeric($val)) $val="'".$val."'";
		$sql="update $table set pub=$val where id=$key;";
		$db->Query("update $table set pub=$val where id=$key;");
		$sql="update med_shipping set pub=$val where cid=$key;";
		$db->Query("update med_shipping set pub=$val where cid=$key;");
}

header("Location: $url");
exit();
?>